public final class ar {

    public int a;
    public int b;
    public int c;
    public int d;
    public int e;

    public ar(int i) {
        b = i;
    }

    public final void a(int i) {
        a = i;
        d = i;
    }

    public final void b(int i) {
        a(a, i);
    }

    public final void a(int i, int j) {
        a = i;
        c = i;
        d = j;
        e = bh.f();
    }

    public final void c(int i) {
        if (a == d) {
            b(i);
        } else {
            c = i;
            a = i;
            d = i;
        }
    }

    public final boolean b(int i, int j) {
        int k;
        int l;
        int i1;
        int j1;
        int k1;
        int l1;
        k = d;
        if (a == k)
            return false;
        l = c;
        i1 = b;
        if ((j1 = j - e) < 0)
            j1 = 0;
        if (j1 >= i1) {
            a = k;
            return true;
        }
        k1 = k - l;
        l1 = 0;
        switch (i) {
            case 0:
                l1 = l + k1 * j1 / i1;
                break;
            case 1:
                int i2 = (100 * j1) / i1;
                l1 = l - (k1 * i2 * (i2 - 200)) / 10000;
                break;
            case 2:
                l1 = l + k1 * ce.c((90 * j1) / i1) / ce.e;
                break;
        }
        if (k1 >= 0 ? l1 > k : l1 < k)
            l1 = k;
        a = l1;
        return true;
    }
}